<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>状态管理</title>
$!{include("import_js_css.html")}
<link rel="stylesheet" type="text/css"
	href="/yueyoga_all2014/app/admin/resources/css/basic.css" />
</head>
<body>
	$!{include("header.html")}
	<div class="container menu_all">
		<div class="tabbable tabs-left" id="div_ul_tab">
			$!{include("system_tab.html")}
			<div class="tab-content">
				<div class="tab-pane active" id="panel-task">
					<div style="padding: 15px;">
						<form class="form-horizontal" role="form" name="taskForm" action="yueyogaAdmin/findStatusList.jhtml" method="post">
							<div class="form-group">
								<label for="inputName" class="col-sm-1 control-label">状态名称</label>
								<div class="col-sm-3">
									<input type="text" class="form-control" name="name" id="inputName" value="" >
								</div>
								<label for="inputCode" class="col-sm-1 control-label">状态编号</label>
								<div class="col-sm-3">
									<input type="text" class="form-control" name="code" id="inputCode" value="">
								</div>
								<br /><br />
								<label for="inputType" class="col-sm-1 control-label">状态类型</label>
								<div class="col-sm-3">
									<select id="inputType" data-live-search="true"
										class="selectpicker show-tick" data-width="100%" name="inputType">
										<option value="">全部</option>
										<option value="1">会员状态</option>
										<option value="2">班级状态</option>
										<option value="3">销售状态</option>
										<option value="4">任务状态</option>
										<option value="5">市场渠到</option>
									</select>
								</div>
								<label for="inputParentCode" class="col-sm-1 control-label">上级状态</label>
								<div class="col-sm-3">
									<!--#var(Status status, List<Status> statuses)-->
									<select id="parentcode" data-live-search="true"
										class="selectpicker show-tick" data-width="100%" name="parentcode">
										<option value="">全部</option>
										<!--#foreach(status in statuses)-->
										<option value="${status.code}">${status.name}</option>
										<!-- #end -->
									</select>
								</div>
								
								<br /><br /><input type="hidden" name="pageNo" id="hidPageNo" />
								<div class="col-sm-offset-2 ubf_search">
									<button type="submit" class="btn btn-default">搜索</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<div class="div_search_result clear">$!{include("status_list.html")}</div>
		</div>
	</div>
</body>
</html>
<script>
//上级状态
$("#inputType").change(function() {
	var inputType=$("#inputType").val();
	$.post(
		"yueyogaAdmin/findStatusBytype.jhtml",
		{"type": inputType},
		function(response) {
			var res = eval("(" + response + ")");
			var sub = document.getElementById("parentcode");
			sub.options.length=0;
			if (res.success) {
				var option = null;
				var code = null;
				var name = null;
				option = new Option("全部", "");
				sub.options.add(option);
				for(var i=0;i<res.items.length;i++) {
					code = res.items[i].code;
					name = res.items[i].name;
					option = new Option(name, code);
					sub.options.add(option);
				}
			} else {
				option = new Option("全部", "");
				sub.options.add(option);
			}
		}
	);
});
$("#inputType").val('${type}');
$("#parentcode").val('${parentcode}');
$('.selectpicker').select2({placeholder:'请选择'});
</script>